package com.gdssoft.pdaweb.service.water.impl;

import java.util.List;

import com.gdssoft.core.service.impl.BaseServiceImpl;
import com.gdssoft.pdaweb.dao.water.WaterMeterMonthPlanDao;
import com.gdssoft.pdaweb.model.water.WaterMeterMonthPlan;
import com.gdssoft.pdaweb.service.water.WaterMeterMonthPlanService;

public class WaterMeterMonthPlanServiceImpl extends BaseServiceImpl<WaterMeterMonthPlan> implements WaterMeterMonthPlanService{
    private WaterMeterMonthPlanDao dao;
	
	public WaterMeterMonthPlanServiceImpl(WaterMeterMonthPlanDao dao) {
		super(dao);
		this.dao=dao;
	}

	@Override
	public List<WaterMeterMonthPlan> getByPlanId(Long id) {
		return this.dao.getByPlanId(id);
	}

	@Override
	public WaterMeterMonthPlan getByPlanIdAndMonth(Long planId, String thisMonth) {
		List<WaterMeterMonthPlan> list = this.dao.getByPlanIdAndMonth(planId,thisMonth);
		if(list.size()>0)
		{
			return list.get(0);
		}
		return null;
	}

}
